﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NewsUC.ascx.cs" Inherits="VCN.home.UC.NewsUC" %>
<div class="newsdetail" style="min-height: 280px;">
    <div class="newsdetail-subtitle">
        <%
            VCN.App.DataAccessLayer.NewsDAO v_dao_news = new VCN.App.DataAccessLayer.NewsDAO();
            int v_newsId;
            
                   
            VCN.App.DataTransferObjects.News v_news_obj= new VCN.App.DataTransferObjects.News();
            if (Request.QueryString["NId"]==null)
            {
                v_news_obj = v_dao_news.selectLatestNews();                
            }
            else
            {
                v_newsId = int.Parse(Request.QueryString["NId"].ToString());
                v_news_obj = v_dao_news.convert(
                v_dao_news.selectById2Dt(new VCN.App.DataTransferObjects.News(v_newsId)))[0];
            }
            if (v_news_obj != null)
            {                
                //DateTime v_datetime = v_news_obj.CreatedDate;
                //Response.Write(string.Format("Cập nhật lúc {0} giờ:{1} phút, ngày {2}", v_datetime.Hour, v_datetime.Second, v_datetime.ToShortDateString()));
        %>
    </div>
    <div class="newsdetail-title" id="lblTitle">
        <p style=" font-size:22px; color:#000000; font-weight:bold; padding-bottom:15px"><%// Ghi tiêu đề cho tin tức.\
            Response.Write(v_news_obj.Title);
        %></p>
    </div>
    <div id="newsdetail-content">
        <table>
            <tr>
                <td class="newsdetail-scontents" valign="top">
                    <div runat="server" id="lblShortContent">
                    </div>
                    <%Response.Write(v_news_obj.ShortContent); %>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="seperator">
                    </div>
                </td>
            </tr>
            <tr>
                <td valign="top" style="margin-top: 15px;" class="newsdetail-contents">
                    <div id="lblContents" runat="server">
                    </div>
                    <% // Nội dung của bản tin.
            Response.Write(v_news_obj.Contents);
                    %>
                </td>
            </tr>
        </table>
        <div class="newsdetail-bottom" style="text-align:right">            
            <div runat="server" id="lblReference">
            </div>( 
            <% Response.Write((v_news_obj.Reference == null || v_news_obj.Reference == "") ? "VCN" : v_news_obj.Reference); %> )
        </div>
        <hr style="border: 1px light black" />
        <% if (m_b_CoTinLienQuan)
           { %>
        <div class="newsdetail-relativeNews">
            <p>
                <b style="font-style:italic; font-weight:normal">Related news:</b></p>
            <div id="lblOtherNews" runat="server">
               <asp:Repeater ID="rpt_other_new" runat="server">
               <HeaderTemplate></HeaderTemplate>
               <ItemTemplate>               
               <asp:HyperLink runat="server" ForeColor="Blue" CssClass="Link_Css" NavigateUrl='<% #"/home/News.aspx?NId="+Eval("ID")%>' Text='<% #"- " +Eval("TITLE")%>'>                                             
               </asp:HyperLink>                    
               <br />
               </ItemTemplate>
               </asp:Repeater>
            </div>
        </div>
        <%} %>
    </div>
    <%} %>
</div>

